<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
	<title>政策制度列表</title>
	<link rel="stylesheet" href="__PUBLIC__/Policy/css/weui.min.css">
	<link rel="stylesheet" href="__PUBLIC__/Policy/css/bootstrap.min.css">
	<script src="__PUBLIC__/Policy/js/jquery-1.8.2.min.js"></script>
	
</head>
<body>


<div style="text-align: center;margin-top:4%; margin-bottom:4%">
	<img src="__PUBLIC__/Policy/img/logo.png" alt="logo" width="40%">
</div>
<div class="form-group">
    <div class="input-group">
      <input class="form-control" type="search" placeholder="请输入内容搜索">
         <div class="input-group-addon">开始搜索</div>
    </div>
  </div>


               
<?php foreach ($list as $k => $v) { ?>
	<div class="weui-cells weui-cells_form">
		<div class="weui-cell weui-cell_switch">
		<div class="weui-cell__bd">{$v['content']}</div>
		<div class="weui-cell__ft">
			<table>
				<tr>
					<td><a href="{:U('/Policy/Index/Postedit',array('id'=>$v['id']))}" class="weui-btn weui-btn_plain-primary weui-btn_mini">编辑</a></td>
					<td><button  value="{$v['id']}" class=" weui-btn_mini weui-btn weui-btn_warn delete">删除</button></td>
				</tr>
			</table>
			
			
		</div>
		</div>
	</div>
<?php }?>



	<ul class="modal-footer no-margin-top ">
	          {$page}
               </ul>
           <div class="weui-footer" id="footer">
                    <p class="weui-footer__links">
                        <a href="javascript:void(0);" class="weui-footer__link">中国航天-神舟软件</a>
                    </p>
                    <p class="weui-footer__text">Copyright &copy; 2008-2016 </p>
            </div> 

	<div class="js_dialog" id="iosDialog2" style="display: none;">
                <div class="weui-mask"></div>
                <div class="weui-dialog">
                    <div class="weui-dialog__bd bds"></div>
                    <div class="weui-dialog__ft">
                        <a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_primary" id="qr">确定</a>
                    </div>
                </div>
            </div>


             <div class="js_dialog" id="iosDialog4" style="display: none;">
            <div class="weui-mask"></div>
            <div class="weui-dialog">
                <div class="weui-dialog__bd">确定要删除么？</div>
                <div class="weui-dialog__ft">
                    <a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_default" id="qrsc">确定</a>
                    <a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_primary" id="qx">取消</a>
                </div>
            </div>
        </div>


</body>
<script>
	$(function(){
		$('.input-group-addon').click(function(){
			var value = $('input[type=search]').val();
			if(!value){
				$('.weui-dialog__bd').text('内容不能为空');
				$('#iosDialog2').show();
				return false;
			}else{
				location.href = '__CONTROLLER__/searchedit/keywords/' + value;
			}
			
			
		})

		$('.delete').click(function(){
			var id = $(this).val();
			$('#iosDialog4').show();
			$('#qx').click(function(){
				$('#iosDialog4').hide();
			})
			$('#qrsc').click(function(){
			$.post("{:U('Policy/index/delete')}",{'id':id},function(e){
					if(e == 1){
						$('#iosDialog4').hide();
						$('#iosDialog2').show();
						$('.bds').text('删除成功');

						
					}else{
						$('#iosDialog4').hide();
						$('#iosDialog2').show();
						$('.bds').text('删除失败');
						
					}
				})
			})
			
		})
		
		$('#qr').click(function(){
			$('#iosDialog2').hide();
			window.location.href = window.location.href +'/'+ Math.random();
			
		})
		
	})
</script>
<style>
	a:link,a:visited{
	 text-decoration:none;  /*超链接无下划线*/
	}
	a:hover{
	 text-decoration:none;  /*鼠标放上去有下划线*/
	}
	p{
		margin:0 0;
	}
	body {
              font-family:Microsoft YaHei;
           }
	 #footer{
                margin-top:30px;
        }
          .weui-cells{
                margin-top: 0.2em;

            }
</style>
</html>
